﻿
@{
    ViewBag.Title = "Details";
}

@model IEnumerable<Message_Board.Models.Message>
<h3>留言主题：@ViewBag.Subject</h3>
<h3>留言类型：@ViewBag.MessageType</h3>
<div style="border:inset">
    <h4>&nbsp;&nbsp;@ViewBag.Content</h4>
</div>
<br/>
<br />
<div>
    <label style="color:aquamarine">楼主：</label>
    <label>@ViewBag.UserName</label>
</div>
<div>
    <label style="color:aquamarine">建立时间：</label>
    <label>@ViewBag.Time</label>
</div>
<fieldset style="margin-top: 30px;">
    <legend>留言</legend>
    <table width="100%">
        <tr>
            <th> 留言内容 </th>
            <th> 留言者 </th>
            <th> 留言时间 </th>
            <th> 留言楼数 </th>
            <th> 回复:</th>
            <th> 操作</th>
            <th> <a href="/Messages/Reply?id=@ViewBag.ID">新回复</a> </th>
        </tr>
        @foreach (var item in Model.Skip(1))
        {
            <tr>
                <td> <label><a href="/Messages/Details2?id=@item.ID">@item.Content</a> </label> </td>
                <td> <label>@item.UserName </label> </td>
                <td> <label>@item.Time</label> </td>
                <td> <label>@item.Number</label> </td>
                <td>
                    @if (item.ReplyName != (string)ViewBag.Name)
                    {<label>@item.ReplyNumber 楼 (@item.ReplyName)</label>}
                    @if (item.ReplyName == (string)ViewBag.Name)
                    {
                        <label>@item.ReplyNumber 楼 (楼主)</label>
                    }
                    <label></label>
                </td>
                <td> <label><a href="/Messages/Reply?id=@item.ID">回复</a></label> </td>
            </tr>  }
    </table>
    <div class="container" style="text-align: center; border:none">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="margin: 0;">
            <ul id="PagerID" class="pagination pagination-sm">
                <li><a href="/Messages/Details?subject=@ViewBag.Subject&currentPage=1">首页 </a></li>
                <li><a href="/Messages/Details?subject=@ViewBag.Subject&currentPage=@((int)ViewBag.currentPage - 1)">上页 </a></li>
                <li>
                    <span>
                        页:
                        <Label ID="lbCurrentPage" style="margin-bottom:0">@ViewBag.currentPage</Label>/<Label ID="lbMaxPage" style="margin-bottom:0">@ViewBag.maxPage</Label>
                    </span>
                </li>
                <li><a href="/Messages/Details?subject=@ViewBag.Subject&currentPage=@((int)ViewBag.currentPage + 1)">下页 </a></li>
                <li><a href="/Messages/Details?subject=@ViewBag.Subject&currentPage=@ViewBag.maxPage">末页 </a></li>
                <li><a onclick="goto()">GoTo </a></li>
                <li>
                    <input type="text" id="txtInputNumber" style="width: 50px;height:28px">
                </li>
            </ul>
        </div>
    </div>
</fieldset>
